home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FishMarket 1.0
/
FishMarket v1.0.iso
/
fishies
/
401-425
/
disk_405
/
gifmachine
/
sources
/
myprintf.c
< prev
next >
Wrap
C/C++ Source or Header
|
1992-05-06
|
712b
|
39 lines
#include <proto/dos.h>
#include <stdarg.h>
void RawDoFmt(char *, APTR, void(*)(), APTR);
#pragma syscall RawDoFmt 20a ba9804
void __stdargs MyPrintf(char *fmt, ...)
{
va_list args;
va_start(args, fmt);
VPrintf((UBYTE *)fmt, (LONG *)args);
Flush(Output());
va_end(args);
}
static void __regargs MySPrintfSupp(char);
void __stdargs MySPrintf(char *buf, char *fmt, ...)
{
va_list args;
va_start(args, fmt);
RawDoFmt(fmt, (APTR)args, MySPrintfSupp, (APTR)buf)
va_end(args);
}
extern long __builtin_getreg(int);
extern void __builtin_putreg(int, char *);
static void __regargs MySPrintfSupp(char Char)
{
char *ptr;
ptr = (char *)__builtin_getreg(11);
*ptr++ = Char;
__builtin_putreg(11, ptr);
}